<!DOCTYPE html>
<html lang="en">
<style>
.ace {
	font-size: .1rem;
	float: right;
}
</style>
<body>
<div class=" admin-content">
	<div class="daohang">
	</div>
	<div class="am-popup am-popup-inner" id="my-popup">
		<div class="am-popup-hd">
			<h4 class="am-popup-title">添加商品一级分类</h4>
			<span data-am-modal-close class="am-close">&times;</span>
		</div>
		<div class="am-popup-bd">
			<form class="am-form" method="post" action="<?php echo site_url() . '/Welcome/user'; ?>">
				<div class="am-form-group am-cf">
					<div class="zuo">分类名</div>
					<div class="you">
						<input type="text" class="am-input-sm" name="title" placeholder="请输入分类名">
					</div>
				</div>
				<div class="am-form-group am-cf">
					<div class="zuo">分类图片</div>
					<div class="you" style="height: 45px;">
						<input type="file" id="doc-ipt-file-1">
						<input type="hidden" class="forPicture" name="picture">
					</div>
				</div>
				<div class="am-form-group am-cf">
					<div class="zuo">规格型号</div>
					<div class="you">
						<input type="text" class="am-input-sm" name="price" placeholder="请输入规格型号">
					</div>
				</div>
				<div class="am-form-group am-cf">
					<div class="zuo">商品外观</div>
					<div class="you">
						<input type="text" class="am-input-sm" name="rivate" placeholder="请输入商品外观">
					</div>
				</div>
				<div class="am-form-group am-cf">
					<div class="you" style="margin-left: 11%;">
						<button type="botton" class="am-btn am-btn-secondary am-radius">发布</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	<div class="admin-biaogelist">
		<div class="listbiaoti am-cf">
			<ul class="am-icon-flag on">
				添加商品分类
			</ul>
			<dl class="am-icon-home" style="float: right;">
				当前位置：首页 > <a href="#">添加商品分类</a>
			</dl>
			<dl>
				<button type="button" class="am-btn am-btn-danger am-round am-btn-xs am-icon-plus" data-am-modal="{target: '#my-popup'}">添加商品一级分类</button>
			</dl>
			<!-- data-am-modal="{target: '#my-popup'}" 弹出层 ID  弹出层 190行 开始  271行结束 --> 
		</div>
		<form class="am-form am-g">
			<table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped am-table-hover">
				<thead>
					<tr class="am-success">
						<th class="table-check"><input type="checkbox"></th>
						<th class="table-id am-text-center">ID</th>
						<th class="table-title">分类名称</th>
						<th class="table-type">图片</th>
						<th class="table-title">规格型号</th>
						<th class="table-type">商品外观</th>
						<!-- <th width="163px" class="table-set">操作</th> -->
					</tr>
				</thead>
				<tbody>
				<?php
					foreach ($result as $key => $value) {
				?>
					<tr>
						<td><input type="checkbox" /></td>
						<td class="am-text-center"><?php echo $value['id']; ?></td>
						<td><a href="#"><?php echo $value['title']; ?></a></td>
						<td><?php echo $value['image']; ?></td>
						<td><?php echo $value['size']; ?><input type="button" value="管理" class="ace" onclick="javascrtpt:window.location.href='<?php echo site_url() . '/Welcome/testa'; ?>'"></td>
						<td><?php echo $value['appearance']; ?><input type="button" value="管理" class="ace" onclick="javascrtpt:window.location.href='<?php echo site_url() . '/Welcome/testa'; ?>'"></td>
					</tr>
				<?php
					}
				?>
				</tbody>
			</table>
			<ul class="am-pagination am-fr">
				<li><a href="<?php echo site_url() . '/Welcome/classification?page=1'; ?>">«</a></li>
			<?php
				for ($i = 1; $i <= $wert; $i++) {
			?>
				
				<li class="am-active"><a href="<?php echo site_url() . '/Welcome/classification?page=' . $i; ?>"><?php echo $i; ?></a></li>
				
			<?php
				}
			?>

				<li><a href="<?php echo site_url() . '/Welcome/classification?page=' . $wert; ?>">»</a></li>
			</ul><hr />
		</form>
		<div class="foods">
			<ul>
				版权所有@2015. 模板收集自 <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> -  More Templates<a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a>
			</ul>
			<dl>
				<a href="" title="返回头部" class="am-icon-btn am-icon-arrow-up"></a>
			</dl>
		</div>
	</div>
</div>
<script type="text/javascript">
$("#doc-ipt-file-1").change(
	function() {
		var formData = new FormData();
		formData.append('youFile', document.getElementById("doc-ipt-file-1").files[0]);
		var url = "<?php echo site_url();?>" + '/Welcome/uploadFile';
		$.ajax({
			url : url,
			type : 'POST',
			data : formData,
			dataType : 'json',
			contentType: false,
			processData: false,
			success : function(data) {
				if (data.status != 1) {
					layer.msg('上传失败，请检查文件格式');
				} else {
					$(".forPicture").val(data.filePath);
				}
			}
		});
	}
);

$(".am-radius").click(
	function() {
		var picture = $(".forPicture").val();
	}
);

</script>
<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/polyfill/rem.min.js"></script>
<script src="assets/js/polyfill/respond.min.js"></script>
<script src="assets/js/amazeui.legacy.js"></script>
<![endif]--> 
<!--[if (gte IE 9)|!(IE)]><!--> 
<script src="<?php echo base_url() . 'public/'; ?>assets/js/amazeui.min.js"></script> 
<!--<![endif]-->
</body>
</html>